//
//  j3RenderingEngine.h
//  HJC3D
//
//  Created by HJC on 11-10-10.
//  Copyright 2011年 __MyCompanyName__. All rights reserved.
//

#ifndef _RENDERINGENGINE_H_
#define _RENDERINGENGINE_H_


#include "Quaternion.h"
#include "Vector.h"

struct Vertex {
    vec3 Position;
    vec4 Color;
};


struct Animation 
{
    Quaternion Start;
    Quaternion End;
    Quaternion Current;
    float Elapsed;
    float Duration;
};



typedef enum
{
    DeviceOrientationUnknown,
    DeviceOrientationPortrait,
    DeviceOrientationPortraitUpsideDown,
    DeviceOrientationLandscapeLeft,
    DeviceOrientationLandscapeRight,
    DeviceOrientationFaceUp,
    DeviceOrientationFaceDown,
} DeviceOrientation;



struct j3RenderingEngine*   CreateRenderer1();
struct j3RenderingEngine*   CreateRenderer2();



struct j3RenderingEngine 
{
    virtual void initialize(int width, int height) = 0;    
    virtual void render() const = 0;
    virtual void updateAnimation(float timeStep) = 0;
    virtual void onRotate(DeviceOrientation newOrientation) = 0;
    
    virtual void onFingerUp(ivec2 location) = 0;
    virtual void onFingerDown(ivec2 location) = 0;
    virtual void onFingerMove(ivec2 oldLocation, ivec2 newLocation) = 0;
    
    virtual ~j3RenderingEngine() {}
};




#endif
